Skip to content

Show ADHOC with a tooltip and add a switch to hide the environment badge - #107183

Merged
MonilBhavsar merged 1 commit into
mainfrom
ionatan_environmentbadgefollowups
Nov 23, 2026
Merged

MonilBhavsar merged 1 commit into
mainfrom
ionatan_environmentbadgefollowups

Conversation

@iwiznia

@iwiznia iwiznia commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Explanation of Change

Follow up to #106695 with the changes asked there:

  • Ad hoc internal test builds show ADHOC in the badge like before, and the version and PR number in a tooltip on hover, since v<version> PR:<number> did not fit next to the logo
  • Adds a Hide environment badge switch to the Troubleshoot page (and the test tools modal), so the badge can be hidden when taking screenshots. It's only shown outside production, same as the badge

Fixed Issues

$ #107182
PROPOSAL:

Tests

  1. Run the app locally and sign in
  2. Verify the DEV badge shows next to the logo
  3. Go to Account > Troubleshoot and turn on Hide environment badge
  4. Verify the badge is gone everywhere
  5. Turn it off again and verify the badge is back

To check the ad hoc tooltip I temporarily forced the tooltip on locally (the label is DEV since the environment is still dev, and the PR number is empty in dev):

tooltip

Switch off:
switch off

Switch on:
switch on

  • Verify that no errors appear in the JS console

Offline tests

Same as tests, the switch is local only

QA Steps

  1. Sign in on staging
  2. Verify the green STG badge shows next to the logo (wide) or the top bar title (narrow)
  3. Go to Account > Troubleshoot and turn on Hide environment badge
  4. Verify the badge is gone
  5. Turn it off and verify the badge is back
  6. Verify there is no Hide environment badge switch and no badge on production
  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I verified any copy / text that was added to the app is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • If new assets were added or existing ones were modified, I verified that:
    • The assets are optimized and compressed (for SVG files, run npm run compress-svg)
    • The assets load correctly across all supported platforms.
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • If the PR adds or modifies the UI:
    • I asked an AI agent to review the changes for accessibility issues and addressed its findings.
    • I tested with a screen reader (VoiceOver on macOS) and verified all new/changed elements are reachable with a logical focus order.
    • I verified all new/changed elements have meaningful accessible names and roles.
    • I verified state changes are announced (e.g. checked/unchecked, expanded/collapsed, selected).
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari

@iwiznia
iwiznia requested review from a team as code owners November 17, 2026 23:09
@iwiznia iwiznia self-assigned this Nov 17, 2026
@expensify-chore-bot
expensify-chore-bot Bot requested review from abdulrahuman5196 and removed request for a team November 17, 2026 23:09
@expensify-chore-bot

Copy link
Copy Markdown

@abdulrahuman5196 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@expensify-chore-bot
expensify-chore-bot Bot requested review from JmillsExpensify and removed request for a team November 17, 2026 23:09
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-17T23:14:07.447200Z c57f66f PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@OSBotify

Copy link
Copy Markdown
Contributor

🦜 Polyglot Parrot! 🦜

Squawk! Looks like you added some shiny new English strings. Allow me to parrot them back to you in other tongues:

View the translation diff
diff --git a/src/languages/de.ts b/src/languages/de.ts
index 83a6197c..c6bacebd 100644
--- a/src/languages/de.ts
+++ b/src/languages/de.ts
@@ -2547,7 +2547,7 @@ const translations: TranslationDeepObject<typeof en> = {
             sentryHighlightedSpanOps: 'Hervorgehobene Spannen-Namen',
             sentryHighlightedSpanOpsPlaceholder: 'ui.interaktion.klick, navigation, ui.laden',
             showBranchNameInTitle: 'Branch-Namen im Browser-Titel anzeigen',
-            hideEnvironmentBadge: 'Umgebungsabzeichen ausblenden',
+            hideEnvironmentBadge: 'Umgebungs-Badge ausblenden',
             betaOverrides: 'Beta-Überschreibungen',
             betaOverridesDescription:
                 'Überschreibungen gelten nur für dieses Gerät und wirken sich nur auf Frontend-Prüfungen aus. Eine Beta behält eine Überschreibung nur so lange, wie sie von den Betas Ihres Kontos abweicht; schalten Sie sie zurück, wird die Überschreibung entfernt. „Alle Überschreibungen zurücksetzen“ stellt die Werte Ihres Kontos wieder her. Einige Betas werden zusätzlich vom Backend gesteuert und können daher weiterhin auf Anfrageebene fehlschlagen.',
diff --git a/src/languages/es.ts b/src/languages/es.ts
index 84cd4f88..4137d2b3 100644
--- a/src/languages/es.ts
+++ b/src/languages/es.ts
@@ -2528,7 +2528,7 @@ const translations: TranslationDeepObject<typeof en> = {
             sentryHighlightedSpanOps: 'Nombres de spans resaltados',
             sentryHighlightedSpanOpsPlaceholder: 'ui.interaction.click, navigation, ui.load',
             showBranchNameInTitle: 'Mostrar nombre de rama en el título del navegador',
-            hideEnvironmentBadge: 'Ocultar insignia de entorno',
+            hideEnvironmentBadge: 'Ocultar distintivo de entorno',
             betaOverrides: 'Anulaciones de betas',
             betaOverridesDescription:
                 'Las anulaciones solo se aplican a este dispositivo y solo afectan a las comprobaciones del frontend. Una beta conserva una anulación solo mientras difiere de las betas de tu cuenta, por lo que al volver a cambiarla se elimina la anulación. «Restablecer todas las anulaciones» recupera los valores de tu cuenta. Algunas betas también están controladas por el backend, así que pueden fallar a nivel de solicitud.',
diff --git a/src/languages/it.ts b/src/languages/it.ts
index 5995097b..1d6b890c 100644
--- a/src/languages/it.ts
+++ b/src/languages/it.ts
@@ -2541,7 +2541,7 @@ const translations: TranslationDeepObject<typeof en> = {
             sentryHighlightedSpanOps: 'Nomi degli intervalli evidenziati',
             sentryHighlightedSpanOpsPlaceholder: 'ui.interaction.click, navigazione, ui.load',
             showBranchNameInTitle: 'Mostra nome del ramo nel titolo del browser',
-            hideEnvironmentBadge: 'Nascondi badge dell’ambiente',
+            hideEnvironmentBadge: 'Nascondi badge ambiente',
             betaOverrides: 'Sostituzioni delle beta',
             betaOverridesDescription:
                 'Le sostituzioni si applicano solo a questo dispositivo e influiscono solo sui controlli del frontend. Una beta mantiene una sostituzione solo finché differisce dalle beta del tuo account, quindi riportandola indietro la sostituzione viene rimossa. «Reimposta tutte le sostituzioni» ripristina i valori del tuo account. Alcune beta sono controllate anche dal backend, quindi possono comunque fallire a livello di richiesta.',
diff --git a/src/languages/pl.ts b/src/languages/pl.ts
index fd3e54c6..308ea81b 100644
--- a/src/languages/pl.ts
+++ b/src/languages/pl.ts
@@ -2579,7 +2579,7 @@ const translations: TranslationDeepObject<typeof en> = {
             sentryHighlightedSpanOps: 'Wyróżnione nazwy zakresów',
             sentryHighlightedSpanOpsPlaceholder: 'kliknięcie interfejsu, nawigacja, ładowanie interfejsu',
             showBranchNameInTitle: 'Pokaż nazwę gałęzi w tytule przeglądarki',
-            hideEnvironmentBadge: 'Ukryj znaczek środowiska',
+            hideEnvironmentBadge: 'Ukryj odznakę środowiska',
             betaOverrides: 'Nadpisywanie bet',
             betaOverridesDescription:
                 'Nadpisywanie działa tylko na tym urządzeniu i tylko po stronie frontendu. Beta zachowuje nadpisanie tylko wtedy, gdy różni się od bet z Twojego konta, więc przełączenie jej z powrotem usuwa nadpisanie. „Zresetuj wszystkie nadpisania” przywraca wartości z Twojego konta. Niektóre bety są też kontrolowane przez backend, więc mogą w pełni nie działać zwłaszcza przy żądaniach wysyłanych do backendu.',

Note

You can apply these changes to your branch by copying the patch to your clipboard, then running pbpaste | git apply 😉

View workflow run

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c57f66f009

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

textStyles={styles.headerEnvBadgeText}
environment={environment}
/>
<Tooltip text={tooltipText}>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Make the build-details tooltip accessible on touch devices

On native iOS/Android ad hoc builds, Tooltip/BaseTooltip/index.native.tsx simply returns its children, and the web implementation also skips tooltips on devices without hover support. Moving the version and PR number exclusively into this tooltip therefore removes access to those details from the badge on all those platforms; users only see ADHOC, with no interaction that reveals which build they are testing. Keep the compact label, but provide a tap/press disclosure or another non-hover fallback for the build details.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not worth it IMO, on touch devices the full version and PR number are still in Account > About, which is where people looked before anyway.

@codecov

codecov Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.

Files with missing lines Coverage Δ
src/CONST/SENTRY_LABEL.ts 100.00% <ø> (ø)
src/ONYXKEYS.ts 100.00% <ø> (ø)
src/components/EnvironmentBadge.tsx 100.00% <100.00%> (ø)
src/components/TestToolMenu.tsx 95.77% <100.00%> (+0.18%) ⬆️
src/libs/ExportOnyxState/masking.ts 93.64% <ø> (ø)
src/libs/actions/User.ts 51.42% <0.00%> (-0.21%) ⬇️
... and 10 files with indirect coverage changes

@shawnborton

Copy link
Copy Markdown
Contributor

Thank you!

@JmillsExpensify JmillsExpensify left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No product review required.

@abdulrahuman5196

Copy link
Copy Markdown
Contributor

@iwiznia Can i start reviewing this PR?

@iwiznia

iwiznia commented Nov 19, 2026

Copy link
Copy Markdown
Contributor Author

Yes please

@abdulrahuman5196

Copy link
Copy Markdown
Contributor

checking on this

@abdulrahuman5196

Copy link
Copy Markdown
Contributor

@MelvinBot could you add the adhoc build label to generate builds for this PR?

@MelvinBot

Copy link
Copy Markdown
Contributor

There’s no ad-hoc build label in this repository. Builds are generated through the Build and deploy apps for testing workflow, which requires an employee to confirm they’ve reviewed the code. I haven’t triggered a build.


view run

@abdulrahuman5196

Copy link
Copy Markdown
Contributor

Ad hoc internal test builds show ADHOC in the badge like before, and the version and PR number in a tooltip on hover, since v PR: did not fit next to the logo

@iwiznia could you kindly trigger adhoc build for this PR? It would be better to check this case.

@github-actions

Copy link
Copy Markdown
Contributor

🚧 JmillsExpensify has triggered a test Expensify/App build. You can view the workflow run here.

@JmillsExpensify

Copy link
Copy Markdown
Contributor

Ad hoc internal test builds show ADHOC in the badge like before, and the version and PR number in a tooltip on hover, since v PR: did not fit next to the logo

@iwiznia could you kindly trigger adhoc build for this PR? It would be better to check this case.

Done.

@github-actions

This comment has been minimized.

@abdulrahuman5196

Copy link
Copy Markdown
Contributor

Reviewer Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
  • I checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified that the composer does not automatically focus or open the keyboard on mobile unless explicitly intended. This includes checking that returning the app from the background does not unexpectedly open the keyboard.
  • I verified tests pass on all platforms & I tested again on:
    • Android: HybridApp
    • Android: mWeb Chrome
    • iOS: HybridApp
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified proper code patterns were followed (see Reviewing the code)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • If the PR adds or modifies the UI:
    • I asked an AI agent to review the changes for accessibility issues and addressed its findings.
    • I tested with a screen reader (VoiceOver on macOS) and verified all new/changed elements are reachable with a logical focus order.
    • I verified all new/changed elements have meaningful accessible names and roles.
    • I verified state changes are announced (e.g. checked/unchecked, expanded/collapsed, selected).
  • For any bug fix or new feature in this PR, I verified that sufficient unit tests are included to prevent regressions in this flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Android: HybridApp

Screenshot 2026-11-24 at 12.14.39 AM.png

Android: mWeb Chrome

Screenshot 2026-11-24 at 12.08.15 AM.png

iOS: HybridApp
iOS: mWeb Safari

Screenshot 2026-11-24 at 12.18.15 AM.png

MacOS: Chrome / Safari
macOS-0-Screen_Recording_2026-11-24_at_12.05.13.AM.mov

@abdulrahuman5196 abdulrahuman5196 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes looks good and works well. Reviewers checklist is also complete.

All yours.

🎀 👀 🎀
C+ Reviewed

@expensify-chore-bot

Copy link
Copy Markdown

@MonilBhavsar Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@MonilBhavsar
MonilBhavsar merged commit 37fcd41 into main Nov 23, 2026
52 of 60 checks passed
@MonilBhavsar
MonilBhavsar deleted the ionatan_environmentbadgefollowups branch November 23, 2026 19:01
@OSBotify

Copy link
Copy Markdown
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@github-actions

Copy link
Copy Markdown
Contributor

🚧 MonilBhavsar has triggered a test Expensify/App build. You can view the workflow run here.

@github-actions

Copy link
Copy Markdown
Contributor

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/MonilBhavsar in version: 9.5.53-0 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

@MelvinBot

Copy link
Copy Markdown
Contributor

No help site update needed — these changes only affect environment badges and testing controls outside production, so they don’t change customer workflows or make any existing article incorrect.


view run

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/arosiclair in version: 9.5.53-3 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

Bundle Size Analysis (Sentry):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants